{extend name="common/layout"}
<!--注意，使用layout模板继承模式，内容须写在任意[block]标签对之间，否则内容不会被渲染-->

{block name="header"}
{include file="common/header"}
{/block}

{block name="style"}
<link href="./static/css/slider.css" rel="stylesheet" />
{/block}

{block name="main"}
{include file="common/navi"}
<div class="body">
    <div class="main-container">
        <!--网站首页-->
    <div class="index-top">
        <div class="slideBox">
            <div class="hd">
                <ul></ul>
            </div>
            <div class="bd">
                <ul>
                    {banner@list cid="1" num="5"}
                    <li>
                        <a href="{$banner.url}"><img src="{$banner.image}" alt="{$banner.title}" /></a>
                    </li>
                    {/banner@list}
                </ul>
            </div>
        </div>
        <div class="slideTxtBox">
            {channel@list id="gt 1" num="3" assign="newsChannel"}{/channel@list}<!--暂不输出，存放为newsChannel的变量-->
            <div class="hd">
                <span class="arrow"><a class="next"></a><a class="prev"></a></span>
                <ul>
                    {foreach name="$newsChannel" item="row"}<!--循环栏目-->
                    <li>{$row.name}</li>
                    {/foreach}
                </ul>
            </div>
            <div class="bd">
                {foreach name="$newsChannel" item="row"} <!--循环栏目-->
                <ul>
                    {content@list cid="$row.id" num="7"}<!--获取栏目下文章-->
                    <li>
                        <span class="date">{$content.date}</span>
                        <a href="{$content.url}" target="_blank">{$content.title|more=36,'...更多'}</a>
                    </li>
                    {/content@list}
                </ul>
                {/foreach}
            </div>
        </div>
    </div>
    <div class="index-grid">
        {channel@list id="gt 1" num="20"}
        <div class="index-item">
            <div class="inner">
                <div class="channel-title">
                    <img src="{$channel.logo}" class="logo" alt="{$channel.name}" />
                    <a href="{$channel.url}">{$channel.name}</a>
                </div>
                {content@list cid="$channel.id"}
                <div class="item-info">
                    <span class="title">
                        <a target="_blank" href="{$content.url}">{$content.title|more=36,'...更多'}</a>
                        {if $content.is_recommend==1}
                        <b style="color: red;">[荐]</b>
                        {/if}
                    </span>
                    <span class="date">{$content.date}</span>
                </div>
                {/content@list}
            </div>
        </div>
        {/channel@list}
    </div>
    </div>
</div>
{/block}

{block name="footer"}
{include file="common/footer"}
{/block}

{block name="script"}
<script type="text/javascript" src="../static/js/jquery.SuperSlide.2.1.3.js" charset="utf-8"></script>
    <script type="text/javascript">
        $(function () {
            var length = $(".slideBox .bd ul li").length;
            if (length > 0) {
                for (var i = 0; i < length; i++) {
                    $(".slideBox .hd ul").append("<li>" + (i + 1) + "</li>");
                }
            }
            $(".slideBox").slide({ mainCell: ".bd ul", autoPlay: true });//滚动图
            $(".slideTxtBox").slide({ effect: "fold", autoPlay: true, easing: "easeInQuint", delayTime: 500 });//滚动文章
        });
    </script>
{/block}